<div class="row">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li>
                <i class="fa fa-dashboard"></i> <a href="index.html">个人资料</a>
            </li>
            <li class="active">
                <i class="fa fa-table"></i> 修改密码
            </li>
        </ol>
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">修改密码</h3>
            </div>
            <form id="changePwdForm" class="form-horizontal" role="form" ng-submit="changePassword()">
                <div class="box-body">
                    <div class="col-sm-offset-2 col-sm-8">
                        <!-- 旧密码 -->
                        <div class="form-group">
                            <label class="col-sm-3 control-label" for="oldPwd">旧密码：</label>
                            <div class="col-sm-8">
                                <input id="oldPwd" name="oldPwd" type="password" class="form-control"  ng-model="oldPwd" placeholder="请输入旧密码" required>
                            </div>
                        </div>
                        <!-- 新密码-->
                        <div class="form-group">
                            <label class="col-sm-3 control-label" for="newPwd">新密码：</label>
                            <div class="col-sm-8">
                                <input id="newPwd" name="newPwd" type="password" class="form-control"
                                       required ng-model="newPwd" placeholder="请输入新密码">
                            </div>
                        </div>
                        <!-- 新密码-->
                        <div class="form-group">
                            <label class="col-sm-3 control-label" for="newPwdTwice">再次输入新密码：</label>
                            <div class="col-sm-8">
                                <input id="newPwdTwice" name="newPwdTwice" type="password" class="form-control"
                                       required ng-model="newPwdTwice" placeholder="再次输入新密码">
                            </div>
                        </div>
                        <br>
                        <div class="col-sm-offset-3 col-sm-8">
                            <button id="changePassword" class="btn btn-info pull-right" type="submit">
                                <i class="fa fa-floppy-o"></i> 修改密码
                            </button>
                        </div>
                        <br>
                        <br>
                        <div class="alert alert-success fade save-success" style="display: none;">
                            <button type="button" class="close" data-dismiss="alert">×</button>
                            <strong style="color: #ffffff;"> 修改成功！</strong>
                        </div>
                        <div class="alert alert-danger fade save-fail" style="display: none;">
                            <button type="button" class="close" data-dismiss="alert">×</button>
                            <strong style="color: #ffffff;"> 修改失败！</strong>
                        </div>
                        <br>
                        <br>
                    </div>
                </div>
                <div class="box-footer">
                </div>
            </form>
        </div>
    </div>
</div>

<script>
    /*表单验证*/
    $("#changePwdForm").validate({
        rules: {
            oldPwd: {
                required: true,
                minlength: 5
            },
            newPwd: {
                required: true,
                minlength: 5
            },
            newPwdTwice: {
                required: true,
                minlength: 5,
                equalTo: "#newPwd"
            }
        },
        messages: {
            oldPwd: {
                required: "请输入密码！",
                minlength: "密码长度最少五位！"
            },
            newPwd: {
                required: "请输入密码！",
                minlength: "密码长度最少五位！"
            },
            newPwdTwice: {
                required: "请输入密码！",
                minlength: "密码长度最少五位！",
                equalTo: "两次密码输入不一致！"
            }
        }
    });
</script>